package com.qiwx.pigeon.data;

import com.qiwx.pigeon.R;

import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;

/**
 * @description
 * @Author qiwx
 * @Date 2020-03-30 14:19
 * 鸽笼状态
 **/
public class CageStatusConfig {
    public static final int PRODUCE_KW = 0;// 空窝
    public static final int PRODUCE_YD = 1; //有蛋
    public static final int PRODUCE_CD = 2; //查蛋
    public static final int PRODUCE_FD = 3; //孵蛋
    public static final int PRODUCE_CZ = 4; //查仔
    public static final int PRODUCE_CZ2 = 5; //二次查仔
    public static final int PRODUCE_CK = 6; //出壳
    public static final int PRODUCE_TW = 7; //调窝 鸽崽
    private static LinkedHashMap<String, Integer> statusMap;

    public static final int LOSE_YD_BFD = 1;//不孵蛋
    public static final int LOSE_YD_BREAKEN = 2;//踩破蛋
    public static final int LOSE_YD_WD = 3;//无蛋
    public static final int LOSE_CD_BFD = 4;//不孵蛋
    public static final int LOSE_CD_BREAKEN = 5;//踩破蛋
    public static final int LOSE_CD_WD = 6;//无蛋
    public static final int LOSE_FD_BFD = 7;//不孵蛋
    public static final int LOSE_FD_BREAKEN = 8;//踩破蛋
    public static final int LOSE_FD_WD = 9;//无蛋
    public static final int LOSE_CZ_BFD = 10;//不孵蛋
    public static final int LOSE_CZ_BREAKEN = 11;//踩破蛋
    public static final int LOSE_CZ_WDWZ = 12;//无蛋无崽

    public static Map<String, Integer> getProduceStatus() {
        if (statusMap == null) {
            statusMap = new LinkedHashMap<>();
            statusMap.put("空窝", PRODUCE_KW);
            statusMap.put("有蛋", PRODUCE_YD);
            statusMap.put("查蛋", PRODUCE_CD);
            statusMap.put("孵蛋", PRODUCE_FD);
            statusMap.put("出壳", PRODUCE_CZ);
            statusMap.put("重新查崽", PRODUCE_CZ2);
            statusMap.put("查乳鸽", PRODUCE_CK);
            statusMap.put("鸽崽调窝", PRODUCE_TW);
        }
        return statusMap;
    }

    public static String getProduceStatusDes(int status) {

        switch (status) {
            case PRODUCE_KW:
                return "空窝";
            case PRODUCE_YD:
                return "有蛋";
            case PRODUCE_CD:
                return "查蛋";
            case PRODUCE_FD:
                return "孵蛋";
            case PRODUCE_CZ:
                return "查崽";
            case PRODUCE_CZ2:
                return "重新查崽";
            case PRODUCE_CK:
                return "查乳鸽";
            case PRODUCE_TW:
                return "鸽崽调窝";
        }
        return "异常";
    }

    //存栏状态 0是空笼 大于1表示存栏状态 具体值代表具体存栏情况
    public static final int STATUS_KL = 0;
    //    public static final int STATUS_CL = 1;
    //0一公一母 1是单只鸽 2 双母鸽 3 双公鸽
    public static final int STATUS_YGYM = 1;
    public static final int STATUS_DZ = 2;
    public static final int STATUS_SM = 3;
    public static final int STATUS_SG = 4;
    public static final int STATUS_DG = 5;//单公
    public static final int STATUS_DM = 6;//单母
    public static final int STATUS_PD = 7;//配对中
    //查蛋状态
    public static final int CHECK_EGG_SHOUJING2 = 1;//两个受精
    public static final int CHECK_EGG_SIJING2 = 2;//两个死精
    public static final int CHECK_EGG_WUJING2 = 3;//2个无精
    public static final int CHECK_EGG_SHOUJING2WUJING1 = 4;//一个受精一个无精
    public static final int CHECK_EGG_SHOUJING2SIJING1 = 5;//一个受精一个死精
    public static final int CHECK_EGG_WUJING2SIJING1 = 11;//一个无精一个死精

    public static final int CHECK_EGG_WUDAN = 6;//无蛋
    public static final int CHECK_EGG_BUFUDAN = 7;//不孵蛋
    public static final int CHECK_EGG_BROKEN = 8;//踩破蛋
    public static final int CHECK_EGG_SHOUJING1 = 9;//一个受精
    public static final int CHECK_EGG_WUJING1 = 10;//一个无精
    public static final int CHECK_EGG_SIJING1 = 12;//一个死精

    //查仔状态
    public static final int CHECK_BABY_WCK = 0;//未出壳
    public static final int CHECK_BABY_CK1 = 1;//出壳1
    public static final int CHECK_BABY_CK2 = 2;//出壳2
    public static final int CHECK_BABY_CK3 = 3;//出壳3
    public static final int CHECK_BABY_NO_EGG_BABY = 4;//无蛋无仔


    public static String getDesByEggStatus(int status) {
        switch (status) {
            case CHECK_EGG_SHOUJING2:
                return "两个受精";
            case CHECK_EGG_SIJING2:
                return "两个死精";
            case CHECK_EGG_WUJING2:
                return "两个无精";
            case CHECK_EGG_SHOUJING2WUJING1:
                return "1受1无";
            case CHECK_EGG_SHOUJING2SIJING1:
                return "1受1死";
            case CHECK_EGG_WUJING2SIJING1:
                return "1无1死";
            case CHECK_EGG_WUDAN:
                return "无蛋";
            case CHECK_EGG_SIJING1:
                return "1死精";
            case CHECK_EGG_WUJING1:
                return "1无精";
            case CHECK_EGG_SHOUJING1:
                return "1受精";

            default:
                return "--";
        }
    }

    //通过受精类型返回下蛋个数
    public static int getAmountByEggStatus(int eggStatus) {
        switch (eggStatus) {
            case CageStatusConfig.CHECK_EGG_SHOUJING2:
            case CageStatusConfig.CHECK_EGG_SIJING2:
            case CageStatusConfig.CHECK_EGG_WUJING2:
                return 2;
            case CageStatusConfig.CHECK_EGG_SHOUJING1:
            case CageStatusConfig.CHECK_EGG_SIJING1:
            case CageStatusConfig.CHECK_EGG_WUJING1:
            case CageStatusConfig.CHECK_EGG_SHOUJING2WUJING1:
            case CageStatusConfig.CHECK_EGG_SHOUJING2SIJING1:
            case CageStatusConfig.CHECK_EGG_WUJING2SIJING1:
                return 1;

        }
        return 0;
    }

    //通过受精类型返回下蛋个数
    public static int getColorByEggStatus(int eggStatus) {
        switch (eggStatus) {
            case CageStatusConfig.CHECK_EGG_SHOUJING2:
            case CageStatusConfig.CHECK_EGG_SHOUJING1:
                return R.color.egg_shouj_color;
            case CageStatusConfig.CHECK_EGG_SIJING2:
            case CageStatusConfig.CHECK_EGG_SIJING1:
                return R.color.egg_sij_color;
            case CageStatusConfig.CHECK_EGG_WUJING2:
            case CageStatusConfig.CHECK_EGG_WUJING1:
                return R.color.egg_wuj_color;
            case CageStatusConfig.CHECK_EGG_SHOUJING2WUJING1:
                return R.color.egg_shou2wuj_color;

            case CageStatusConfig.CHECK_EGG_SHOUJING2SIJING1:
                return R.color.egg_shou2sij_color;
            case CageStatusConfig.CHECK_EGG_WUJING2SIJING1:
                return R.color.egg_wu2sij_color;
        }
        return R.color.green_light;
    }

    public static String getShowByStatus(int status) {
        if (status == CageStatusConfig.STATUS_DZ) {
            return "单只";
        } else if (status == CageStatusConfig.STATUS_SG) {
            return "双公";
        } else if (status == CageStatusConfig.STATUS_SM) {
            return "双母";
        } else if (status == CageStatusConfig.STATUS_PD) {
            return "配对中";
        } else if (status == CageStatusConfig.STATUS_DM) {
            return "单母";

        } else if (status == CageStatusConfig.STATUS_DG) {
            return "单公";
        } else if (status == CageStatusConfig.STATUS_KL) {
            return "空笼";

        } else {
            return "一公一母";

        }
    }

}
